package com.example.wiki.auth.exception;

public class BusinessException extends RuntimeException{

    private BusinessExceptionCode code;
    private Number status;

    public Number getStatus() {
        return status;
    }

    public void setStatus(Number status) {
        this.status = status;
    }

    public BusinessException (BusinessExceptionCode code, Number status) {
        super(code.getDesc());
        this.code = code;
        this.status = status;
    }

    public BusinessExceptionCode getCode() {
        return code;
    }

    public void setCode(BusinessExceptionCode code) {
        this.code = code;
    }

    @Override
    public String toString() {
        return "BusinessException{" +
                "code=" + code +
                ", status=" + status +
                "} " + super.toString();
    }

    /**
     * 不写入堆栈信息，提高性能
     */
    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
